package com.bestv.datamodeler;

import com.bestv.mahout.model.RecommendModeler;
import com.bestv.utils.config.GlobalSettings;

/**
 * Created by Henry on 14-5-14.
 */
public class BestvModeler {
    public static void main(String[] args) {
        String[] modelTrainers = {
                "com.bestv.mahout.model.cf.impl.MostSimilarModelTrainer"
        };

        RecommendModeler modeler = new RecommendModeler();
        modeler.setTrainDataFolder(GlobalSettings.getInstance().getProgramCFTrainDataFolder());
        modeler.setTrainFilePattern("scoredata_movie\\..*");
        modeler.setTrainTimeWindow(30 * 24 * 60 * 60);
        modeler.setDelimiterRegex("\\|");
        modeler.setEntityName("program");
        modeler.setTypeName("movie");
        modeler.setModelTrainers(modelTrainers);
        modeler.execute();

        RecommendModeler modeler2 = new RecommendModeler();
        modeler2.setTrainDataFolder(GlobalSettings.getInstance().getSeriesCFTrainDataFolder());
        modeler2.setTrainFilePattern("scoredata_drama\\..*");
        modeler2.setTrainTimeWindow(30 * 24 * 60 * 60);
        modeler2.setDelimiterRegex("\\|");
        modeler2.setEntityName("series");
        modeler2.setTypeName("drama");
        modeler2.setModelTrainers(modelTrainers);
        modeler2.execute();

        System.exit(0);
    }
}
